package com.android.luhnchecking.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DbHelper extends SQLiteOpenHelper {
	public final static String DB_NAME = "ACCOUNT";
	public final static int DB_VERISON = 1;

	// Table name
	public static final String TABLE_ACCOUNT = "Account";
	// Column name
	public static String COLUMN_ID = "id";
	public static String COLUMN_ACCOUNT_NUMBER = "title";
	public static String COLUMN_STATUS = "content";
	public static String COLUMN_TIME = "alarm_id";

	// Creating table query
	private final String CREATE_ALARM = "create table " + TABLE_ACCOUNT + "("
			+ COLUMN_ID + " integer primary key not null unique,"
			+ COLUMN_ACCOUNT_NUMBER + " text not null," + COLUMN_STATUS
			+ " integer not null," + COLUMN_TIME + " integer not null" + ");";

	public DbHelper(Context context) {
		super(context, DB_NAME, null, DB_VERISON);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		db.execSQL(CREATE_ALARM);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int arg1, int arg2) {
		db.execSQL("DROP TABLE IF ESIXT " + TABLE_ACCOUNT);
	}

}
